PHP

How to send a text e-mail message in PHP | PHP program

How to send a text e-mail message in PHP | PHP program

How to send a text e-mail message in PHP | PHP program

We will demonstrate how we can send a text email message using the PHP program.

<?php


ini_set("sendmail_from", "[email protected]");

$header = "From:[email protected] \r\n";
$to = "[email protected]";
$sub = "Subject of the mail";
$msg = "Hello message from email";

$isSuccess = mail($to, $sub, $msg, $header);

if ($isSuccess == true)
{
    printf("Email send successfully");
}
else
{
    printf("Email sending failed");
}
?>
TutorialsLink Curator

This is an official account managed by the team TutorialsLink Community